package src;

import java.awt.Graphics;
import java.awt.Image;

public class Bar {
	
	Image imgStart, imgEnd, imgMiddle;
	int middleCount, XCoordStart, YCoord, width;
	
	public Bar(String imgPathStart, String imgPathEnd, String imgPathMiddle, int StartX, int EndX, int y, int ImgWidth, int middle){
		imgStart = ResourceLoader.getImage(imgPathStart);
		imgEnd = ResourceLoader.getImage(imgPathEnd);
		imgMiddle = ResourceLoader.getImage(imgPathMiddle);
		middleCount = middle;
		XCoordStart = StartX;
		width = ImgWidth;
		YCoord = y;
	}
	
	public void draw(Graphics g){
		for(int i = 1; i < middleCount; i++){
			if(i == 1){
				g.drawImage(imgStart, XCoordStart, YCoord, null);
			}else if(i > 1 && i < middleCount){
				g.drawImage(imgMiddle, XCoordStart + width * (i-1), YCoord, null);
			}else if(i == middleCount){
				g.drawImage(imgEnd, XCoordStart + width * (i - 1), YCoord, null);
			}
		}
	}

}
